cmake_minimum_required(VERSION 3.10)
project(manual_iteration)

if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
    add_compile_options(-std=c++20)
  else()
    add_compile_options(-std=c++17 -fconcepts)
    include_directories(../../third-party/cmcstl2/include)
  endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang AND
    CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
  add_compile_options(-std=c++20)
elseif(MSVC)
  if(MSVC_VERSION GREATER_EQUAL 1930)
    add_compile_options(/std:c++20 /Zc:__cplusplus)
  else()
    add_compile_options(/std:c++latest /permissive- /Zc:__cplusplus)
  endif()
else()
  message(FATAL_ERROR "Unrecognized compiler")
endif()

add_executable(test_fibonacci test_fibonacci.cpp)
